package com.jzit168.library_base.baseVB

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.viewbinding.ViewBinding
import com.jzit168.library_base.base.BaseFragment

/**
 *@Desc: 携带创建ViewBinding的基类Fragment
 *@Author: Android Developer
 *@Date: 2020/10/14
 *
 **/
abstract class BaseVBFragment<VB : ViewBinding> : BaseFragment() {

    open lateinit var binding: VB

    abstract fun getViewBinding(inflater: LayoutInflater, container: ViewGroup?): VB

    override fun initView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        binding = getViewBinding(inflater, container)
        return binding.root
    }
}